<?php
session_start();
include_once 'setup/setup.php';
if($_GET['act']=='login')
{
	if($_POST['user'] == $ADM && $_POST['pass'] ==$ADM_PWD)
	{
		$_SESSION['auth']=TRUE;
		header('location:admin.php');
	}else{
		header("Content-type: text/html");
		echo "<html><head>";
		echo ("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
		echo "</head><body>";
		echo("您的帳號或是密碼有誤!");
		echo "</body></html>";
		exit;
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.2.0/build/reset-fonts-grids/reset-fonts-grids.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.3.0/build/base/base-min.css">

</head>

<body>
<form id="form1" name="form1" method="post" action="?act=login">
  <label>帳號
  <input name="user" type="text" id="user" />
  </label>
  <p>
    <label>密碼
    <input name="pass" type="password" id="pass" />
    </label>
  </p>
  <p>
    <label>
    <input type="submit" name="Submit" value="登入" />
    </label>
  </p>
</form>
</body>
</html>
